#!/bin/sh
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################

# Fill in the below environment variables.
#
# If you're not sure what these paths should be,
# you can use the find command to try to locate them.
# For example, NUMPY_INCLUDE_PATH contains the file
# arrayobject.h. So you can search for it like this:
#
# find /usr -name arrayobject.h
#
# (it'll almost certainly be under /usr)

# CUDA toolkit installation directory.
export CUDA_INSTALL_PATH=/opt/software/cudatoolkit/6.0

# Python include directory. This should contain the file Python.h, among others.
#export PYTHON_VERSION=2.7
#export PYTHON_INCLUDE_PATH=$HOME/anaconda/include/python2.7
#export PYTHON_LIB_PATH=$HOME/anaconda/lib
# make sure that u can config python with PKG-CONFIG

# Numpy include directory. This should contain the file arrayobject.h, among others.
export NUMPY_INCLUDE_PATH=$HOME/anaconda/lib/python2.7/site-packages/numpy/core/include/numpy
#export NUMPY_LIB_PATH=$HOME/anaconda/lib/python2.7/site-packages/numpy/core/lib

# ATLAS library directory. This should contain the file libcblas.so, among others.
export ATLAS_INCLUDE_PATH=/opt/software/ATLAS/3.8.4--GCC-4.4.5/include
export ATLAS_LIB_PATH=/usr/lib64/atlas

# You don't have to change these:
export LD_LIBRARY_PATH=$CUDA_INSTALL_PATH/lib64:$LD_LIBRARY_PATH
export CUDA_SDK_PATH=$CUDA_INSTALL_PATH/samples
export PATH=$PATH:$CUDA_INSTALL_PATH/bin

# >>>>>>>>>>>>>>>>>>>>> Makesure PYTHON and OPENCV could be found by pkg-config <<<<<<<<<<<
export PKG_CONFIG_PATH=/opt/software/OpenCV/2.4.9--GCC-4.4.5/lib/pkgconfig:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH=/opt/software/OpenCV/2.4.9--GCC-4.4.5/lib/pkgconfig:$PKG_CONFIG_PATH

cd util && make numpy=1 -j $* && cd ..
cd nvmatrix && make -j $* && cd ..
cd cudaconv3 && make -j $* && cd ..
cd cudaconvnet && make -j $* && cd ..
cd make-data/pyext && make -j $* && cd ../..
